class AreaPersonObj {
  String areaName;
  int departId;
  String departName;
  int iconId;
  int id;
  int jobId;
  String jobName;
  String name;
  bool online;
  int picId;
  String sn;
  String workCompany;
  int workCompanyId;

  String type;
  String typeName;

  AreaPersonObj(
      {this.areaName,
      this.departId,
      this.departName,
      this.iconId,
      this.id,
      this.jobId,
      this.jobName,
      this.name,
      this.online,
      this.picId,
      this.sn,
      this.workCompany,
      this.workCompanyId,
      this.type,
      this.typeName});

  factory AreaPersonObj.fromJson(Map<String, dynamic> json, String typeName) {
    return AreaPersonObj(
        areaName: json['areaName'],
        departId: json['departId'],
        departName: json['departName'] ?? "-",
        iconId: json['iconId'],
        id: json['id'],
        jobId: json['jobId'],
        jobName: json['jobName'] ?? "-",
        name: json['name'],
        online: json['online'],
        picId: json['picId'],
        sn: json['sn'],
        workCompany: json['workCompany'],
        workCompanyId: json['workCompanyId'],
        type: json['type'] ?? "",
        typeName: typeName);
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['areaName'] = this.areaName;
    data['departId'] = this.departId;
    data['departName'] = this.departName;
    data['iconId'] = this.iconId;
    data['id'] = this.id;
    data['jobId'] = this.jobId;
    data['jobName'] = this.jobName;
    data['name'] = this.name;
    data['online'] = this.online;
    data['sn'] = this.sn;
    data['workCompany'] = this.workCompany;
    data['workCompanyId'] = this.workCompanyId;
    if (this.picId != null) {
      data['picId'] = this.picId;
    }
    return data;
  }
}
